from django.db import models
'''
Mayron Cachina
on 20/06/2008
'''

class Host(models.Model):
    nome    = models.CharField(max_length=40)
    usuario = models.CharField(max_length=40)
    senha   = models.CharField(max_length=40)
    
    class Admin:
        pass   
    
    def __unicode__(self):
        return self.nome

class Dominio(models.Model):
    nome     = models.CharField(max_length=255)
    hospedagem = models.ForeignKey(Host)
    link     = models.CharField(max_length=255)
    dns1     = models.CharField(max_length=40, blank=True)
    dns2     = models.CharField(max_length=40, blank=True)
    redirect = models.BooleanField()
    
    class Admin:
        pass   
    
    def __unicode__(self):
        return self.nome
  
class Cliente(models.Model):
    nome     = models.CharField(max_length=60)
    cpf      = models.CharField(verbose_name='CPF/CNPJ', max_length=12, blank=True)
    email    = models.EmailField()
    telefone = models.CharField(max_length=11, blank=True)
    dominio  = models.ForeignKey(Dominio)

    class Admin:
        pass
    
    def __unicode__(self):
        return self.nome